class Cartmodel {
  int status;
  String message;
  CartmodelData data;

  Cartmodel({this.status, this.message, this.data});

  Cartmodel.fromJson(Map<String, dynamic> json) {
    status = json['status'];
    message = json['message'];
    data = json['data'] != null ? new CartmodelData.fromJson(json['data']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['status'] = this.status;
    data['message'] = this.message;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    return data;
  }
}

class CartmodelData {
  int grade;
  List<GoodList> goodList;
  int totalCount;

  CartmodelData({this.grade, this.goodList, this.totalCount});

  CartmodelData.fromJson(Map<String, dynamic> json) {
    grade = json['grade'];
    if (json['goodList'] != null) {
      goodList = new List<GoodList>();
      json['goodList'].forEach((v) {
        goodList.add(new GoodList.fromJson(v));
      });
    }
    totalCount = json['totalCount'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['grade'] = this.grade;
    if (this.goodList != null) {
      data['goodList'] = this.goodList.map((v) => v.toJson()).toList();
    }
    data['totalCount'] = this.totalCount;
    return data;
  }
}

class GoodList {
  int cartId;
  int goodsId;
  String goodsModel;
  String goodsNo;
  int categoryId2;
  String goodsName;
  int goodsType;
  String price;
  String marketPrice;
  String freight;
  int stockNum;
  String coverImg;
  int brandId;
  int cartNum;
  int isChecked;
  Null specValues;
  String brandName;
  String brandImg;

  GoodList(
      {this.cartId,
      this.goodsId,
      this.goodsModel,
      this.goodsNo,
      this.categoryId2,
      this.goodsName,
      this.goodsType,
      this.price,
      this.marketPrice,
      this.freight,
      this.stockNum,
      this.coverImg,
      this.brandId,
      this.cartNum,
      this.isChecked,
      this.specValues,
      this.brandName,
      this.brandImg});

  GoodList.fromJson(Map<String, dynamic> json) {
    cartId = json['cart_id'];
    goodsId = json['goods_id'];
    goodsModel = json['goods_model'];
    goodsNo = json['goods_no'];
    categoryId2 = json['category_id2'];
    goodsName = json['goods_name'];
    goodsType = json['goods_type'];
    price = json['price'];
    marketPrice = json['market_price'];
    freight = json['freight'];
    stockNum = json['stock_num'];
    coverImg = json['cover_img'];
    brandId = json['brand_id'];
    cartNum = json['cart_num'];
    isChecked = json['is_checked'];
    specValues = json['spec_values'];
    brandName = json['brand_name'];
    brandImg = json['brand_img'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['cart_id'] = this.cartId;
    data['goods_id'] = this.goodsId;
    data['goods_model'] = this.goodsModel;
    data['goods_no'] = this.goodsNo;
    data['category_id2'] = this.categoryId2;
    data['goods_name'] = this.goodsName;
    data['goods_type'] = this.goodsType;
    data['price'] = this.price;
    data['market_price'] = this.marketPrice;
    data['freight'] = this.freight;
    data['stock_num'] = this.stockNum;
    data['cover_img'] = this.coverImg;
    data['brand_id'] = this.brandId;
    data['cart_num'] = this.cartNum;
    data['is_checked'] = this.isChecked;
    data['spec_values'] = this.specValues;
    data['brand_name'] = this.brandName;
    data['brand_img'] = this.brandImg;
    return data;
  }
}